//-------------------------------------------------------------
// Map: Venice
// Last update 02/06/04 chavo
//-------------------------------------------------------------

game_manager
{
	spawn
	{

		remapshader "models/mapobjects/tanks_sd/mg42turret" "models/mapobjects/tanks_c1/mg42turret_c1"
		remapshader "models/mapobjects/tanks_sd/churchill_flat" "models/mapobjects/tanks_c1/churchill_flat_c1"

		remapshaderflush

		//Game Rules
		wm_axis_respawntime	20
		wm_allied_respawntime	15
		wm_number_of_objectives 7
		wm_set_round_timelimit	15

		// Objectives
		// 1: Axis AT-Gun
		// 2: Blow Axis Outpost
		// 3: Blow library front doors
		// 4: Steal Relic
		// 5: Escape with relic
		// 6: Allied command post
		// 7: Axis command post

		// Current main objectives for each team (0=Axis, 1=Allies)
		wm_set_main_objective		1	0
		wm_set_main_objective		1	1

		wm_objective_status 1 0 0
		wm_objective_status 1 1 0
		wm_objective_status 2 0 0
		wm_objective_status 2 1 0
		wm_objective_status 3 0 0
		wm_objective_status 3 1 0
		wm_objective_status 4 0 0
		wm_objective_status 4 1 0
		wm_objective_status 5 0 0
		wm_objective_status 5 1 0
		wm_objective_status 6 0 0
		wm_objective_status 6 1 0
		wm_objective_status 7 0 0
		wm_objective_status 7 1 0


		// Stopwatch mode defending team (0=Axis, 1=Allies)
		wm_set_defending_team	0

		// Winner on expiration of round timer (0=Axis, 1=Allies)
		wm_setwinner	0

		// Jeco: Increase both Axis and Allied Recharge Time due to both CP's not present.

		setchargetimefactor 1 soldier 0.75
		setchargetimefactor 1 lieutenant 0.75
		setchargetimefactor 1 medic 0.75
		setchargetimefactor 1 engineer 0.75
		setchargetimefactor 1 covertops 0.75

		setchargetimefactor 0 soldier 0.75
		setchargetimefactor 0 lieutenant 0.75
		setchargetimefactor 0 medic 0.75
		setchargetimefactor 0 engineer 0.75
		setchargetimefactor 0 covertops 0.75

		accum 4 set 0 // have the Allies blown the outpost?

		//Tank location and status
		globalaccum 1 set 0	//Tank location on the spline
		globalaccum 2 set 1     //Tank status (0=disabled, 1=enabled)
		globalaccum 3 set 0     //Gun fired at tank  (0=false, 1=92, 2=113, 3=134, 4=155)

		// start triggered loops on/off as required (eg: command post radio sounds)
		disablespeaker allied_radio_sound
		disablespeaker axis_radio_sound
		
		trigger axisbasedoor kill
		trigger axisbasedoor2 kill
		trigger outpostaxisdoor kill
		
		wait 500
		setstate outpost_axis_spawns invisible
		setstate outpostblob invisible
		setstate outpostaxisdoor invisible
		setautospawn	"Axis Spawn"	0
		setautospawn	"Allied Spawn"	1
	}

	trigger allies_win
	{
		wm_setwinner	1
		wm_announce "Allied team escaped with the Relic!"

		wm_teamvoiceannounce 0 "venice_axis_end"
		wm_teamvoiceannounce 1 "venice_allies_end"

		wm_objective_status 5 0 2
		wm_objective_status 5 1 1

		wait 9000
		wm_endround
	}

	//----------------------------------------------------------------------
	// Destroying the Axis Outpost
	//----------------------------------------------------------------------
	trigger objective2
	{
		accum 4 abort_if_not_equal 0

		wait 2000


		wm_teamvoiceannounce 0 "venice_axis_obj_outpost"
		wm_teamvoiceannounce 1 "venice_allies_obj_outpost"

		wm_objective_status 2 0 2
		wm_objective_status 2 1 1

		alertentity outpost_axis_spawns
		alertentity outpost_allied_spawns
		alertentity outpostblob		// Outpost team_WOLF_objective

		setautospawn	"Axis Spawn"	0
		setautospawn	"Outpost"	1

		accum 4 set 1
		wm_set_main_objective		3	0
		wm_set_main_objective		3	1
		wm_set_round_timelimit 20

	}

}

// _____________________
// _____________________
// Jec: removed cp stuff
// _____________________
// _____________________
// ============================================================================
// Tank stuff starts here
// ============================================================================
tank_sound
{
	trigger start
	{
		trigger tank sound_start
		wait 3400
		trigger tank sound_move
	}

	trigger stop
	{
		trigger tank sound_stop
		wait 1400
		trigger tank sound_idle
	}

	trigger rebirth
	{
		trigger tank sound_rebirth
		wait 1400
		trigger tank sound_idle
	}
	
}

// digibob: converting truck script from goldrush over...
// ============================================================================
// accum 0, dynamite count
// accum 1
//  - bit 0: bridge state		( 0 = not built,	1 = built		)
//  - bit 1: blank 			(						)
//  - bit 2: spline status 		( 0 = not moving, 	1 = moving 		)
//  - bit 3: stuck check flag 		( 0 = not stuck, 	1 = stuck 		)
//  - bit 4: blank 			(						)									)
//  - bit 5: track state		( 0 = stopped,		1 = forward		)
//  - bit 6: temp register 		(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX)
//  - bit 7: death status 		( 0 = alive, 		1 = dead		)
//  - bit 8: player check 		( 0 = players, 		1 = no players		)
//  - bit 9: visible state		( 0 = alive, 		1 = dead		)
// accum 2, blank
// accum 3, current movement loop position
// accum 4, stop counter
// accum 5, lockout ref counter
// accum 6, blank
// accum 7, blank
// ===========================================================================================
// spline points are spln0 -> spln65 tunnel1 -> tunnel12 spln66 -> spln86 spln2_0 -> spln2_39
// ===========================================================================================
// track events:
//  - tracks_forward
//  - tracks_stop
//  - tracks_turn_left
//  - tracks_turn_right

tank
{
	spawn
	{
		wait 50
		
		setstate tank invisible

		//Reset the tank into correct position
		followspline 0 spln_st 10000 wait length -64

	}

//============================================================================================
	trigger startfire
	{
		startanimation 67 8 10 nolerp norandom
	}

	trigger stopfire
	{
		startanimation 0 1 15 nolerp norandom
	}
// ===========================================================================================
	trigger sound_idle
	{
		stopsound
		playsound sound/vehicles/tank/tank_idle.wav looping volume 512
	}

	trigger sound_start
	{
		stopsound
		playsound sound/vehicles/tank/tank_revup.wav volume 196
	}

	trigger sound_move
	{
		stopsound
		playsound sound/vehicles/tank/tank_move.wav looping volume 512
	}

	trigger sound_stop
	{
		stopsound
		playsound sound/vehicles/tank/tank_revdown.wav volume 196
	}

	trigger sound_death
	{
		stopsound
		playsound sound/vehicles/tank/tank_stop.wav volume 256
	}

	trigger sound_rebirth
	{
		stopsound
		playsound sound/vehicles/tank/tank_start.wav volume 196
	}

	trigger death_sound_play
	{
		playsound sound/venice_c1/tank_hit.wav volume 256
	}

	trigger avre_fire
	{
		playsound sound/venice_c1/tank_canon.wav volume 300
	}

	trigger spin_start
	{
		stopsound
		playsound sound/vehicles/tank/turret_spin.wav looping volume 127
	}

	trigger spin_stop
	{
		stopsound
		playsound sound/vehicles/tank/turret_end.wav volume 96
	}
// ===========================================================================================
	trigger tracks_forward
	{
		accum 1 abort_if_bitset 5
		accum 1 bitset 5

		remapshader models/mapobjects/tanks_sd/bits_r textures/venice_props_c1/bits_forward_c1
		remapshader models/mapobjects/tanks_sd/wheel_r models/mapobjects/tanks_sd/wheel_forward
		remapshader models/mapobjects/tanks_sd/bits_l textures/venice_props_c1/bits_forward_c1
		remapshader models/mapobjects/tanks_sd/wheel_l models/mapobjects/tanks_sd/wheel_forward
		remapshaderflush
	}

	trigger tracks_turn_left
	{
		remapshader models/mapobjects/tanks_sd/bits_r textures/venice_props_c1/bits_forward_c1
		remapshader models/mapobjects/tanks_sd/wheel_r models/mapobjects/tanks_sd/wheel_forward
		remapshader models/mapobjects/tanks_sd/bits_l textures/venice_props_c1/bits_backward_c1
		remapshader models/mapobjects/tanks_sd/wheel_l models/mapobjects/tanks_sd/wheel_backward
		remapshaderflush
	}

	trigger tracks_turn_right
	{
		remapshader models/mapobjects/tanks_sd/bits_r textures/venice_props_c1/bits_backward_c1
		remapshader models/mapobjects/tanks_sd/wheel_r models/mapobjects/tanks_sd/wheel_backward
		remapshader models/mapobjects/tanks_sd/bits_l textures/venice_props_c1/bits_forward_c1
		remapshader models/mapobjects/tanks_sd/wheel_l models/mapobjects/tanks_sd/wheel_forward
		remapshaderflush
	}

	trigger tracks_stop
	{
		accum 1 abort_if_not_bitset 5
		accum 1 bitreset 5

		remapshader models/mapobjects/tanks_sd/bits_r textures/venice_props_c1/bits_r_c1
		remapshader models/mapobjects/tanks_sd/wheel_r models/mapobjects/tanks_sd/wheel_r
		remapshader models/mapobjects/tanks_sd/bits_l textures/venice_props_c1/bits_l_c1
		remapshader models/mapobjects/tanks_sd/wheel_l models/mapobjects/tanks_sd/wheel_l
		remapshaderflush
	}
// ===========================================================================================
// ===========================================================================================
	trigger run_incpos
	{
		accum 3 inc 1
		globalaccum 1 inc 1
	}

	trigger run_continue
	{
		trigger self run_incpos
		trigger self deathcheck
		trigger self stopcheck
		trigger self move
	}
// ===========================================================================================
// ===========================================================================================
// movement
	trigger move_check
	{
		trigger self stuck_check
		accum 1 abort_if_bitset 3

		trigger self dispatch
	}

	trigger move
	{
		trigger self move_check

		wait 500

		trigger self move
	}

	trigger dispatch
	{
		accum 3 trigger_if_equal 0 tank run_0
		accum 3 trigger_if_equal 1 tank run_1
		accum 3 trigger_if_equal 2 tank run_2
		accum 3 trigger_if_equal 3 tank run_3
		accum 3 trigger_if_equal 4 tank run_4
		accum 3 trigger_if_equal 5 tank run_5
		accum 3 trigger_if_equal 6 tank run_6
		accum 3 trigger_if_equal 7 tank run_7
		accum 3 trigger_if_equal 8 tank run_8
		accum 3 trigger_if_equal 9 tank run_9
		accum 3 trigger_if_equal 10 tank run_10
		accum 3 trigger_if_equal 11 tank run_11
		accum 3 trigger_if_equal 12 tank run_12
		accum 3 trigger_if_equal 13 tank run_13
		accum 3 trigger_if_equal 14 tank run_14
		accum 3 trigger_if_equal 15 tank run_15
		accum 3 trigger_if_equal 16 tank run_16
		accum 3 trigger_if_equal 17 tank run_17
		accum 3 trigger_if_equal 18 tank run_18
		accum 3 trigger_if_equal 19 tank run_19
		accum 3 trigger_if_equal 20 tank run_20
		accum 3 trigger_if_equal 21 tank run_21
		accum 3 trigger_if_equal 22 tank run_22
		accum 3 trigger_if_equal 23 tank run_23
		accum 3 trigger_if_equal 24 tank run_24
		accum 3 trigger_if_equal 25 tank run_25
		accum 3 trigger_if_equal 26 tank run_26
		accum 3 trigger_if_equal 27 tank run_27
		accum 3 trigger_if_equal 28 tank run_28
		accum 3 trigger_if_equal 29 tank run_29
		accum 3 trigger_if_equal 30 tank run_30
		accum 3 trigger_if_equal 31 tank run_31
		accum 3 trigger_if_equal 32 tank run_32
		accum 3 trigger_if_equal 33 tank run_33
		accum 3 trigger_if_equal 34 tank run_34
		accum 3 trigger_if_equal 35 tank run_35
		accum 3 trigger_if_equal 36 tank run_36
		accum 3 trigger_if_equal 37 tank run_37
		accum 3 trigger_if_equal 38 tank run_38
		accum 3 trigger_if_equal 39 tank run_39
		accum 3 trigger_if_equal 40 tank run_40
		accum 3 trigger_if_equal 41 tank run_41
		accum 3 trigger_if_equal 42 tank run_42
		accum 3 trigger_if_equal 43 tank run_43
		accum 3 trigger_if_equal 44 tank run_44
		accum 3 trigger_if_equal 45 tank run_45
		accum 3 trigger_if_equal 46 tank run_46
		accum 3 trigger_if_equal 47 tank run_47
		accum 3 trigger_if_equal 48 tank run_48
		accum 3 trigger_if_equal 49 tank run_49
		accum 3 trigger_if_equal 50 tank run_50

		//fire the cannon at truck
		accum 3 trigger_if_equal 51 tank run_51

		accum 3 trigger_if_equal 52 tank run_52
		accum 3 trigger_if_equal 53 tank run_53
		accum 3 trigger_if_equal 54 tank run_54
		accum 3 trigger_if_equal 55 tank run_55
		accum 3 trigger_if_equal 56 tank run_56
		accum 3 trigger_if_equal 57 tank run_57
		accum 3 trigger_if_equal 58 tank run_58
		accum 3 trigger_if_equal 59 tank run_59
		accum 3 trigger_if_equal 60 tank run_60
		accum 3 trigger_if_equal 61 tank run_61
		accum 3 trigger_if_equal 62 tank run_62
		accum 3 trigger_if_equal 63 tank run_63
		accum 3 trigger_if_equal 64 tank run_64
		accum 3 trigger_if_equal 65 tank run_65
		accum 3 trigger_if_equal 66 tank run_66
		accum 3 trigger_if_equal 67 tank run_67
		accum 3 trigger_if_equal 68 tank run_68
		accum 3 trigger_if_equal 69 tank run_69
		accum 3 trigger_if_equal 70 tank run_70
		accum 3 trigger_if_equal 71 tank run_71
		accum 3 trigger_if_equal 72 tank run_72
		accum 3 trigger_if_equal 73 tank run_73
		accum 3 trigger_if_equal 74 tank run_74
		accum 3 trigger_if_equal 75 tank run_75
		accum 3 trigger_if_equal 76 tank run_76
		accum 3 trigger_if_equal 77 tank run_77
		accum 3 trigger_if_equal 78 tank run_78
		accum 3 trigger_if_equal 79 tank run_79
		accum 3 trigger_if_equal 80 tank run_80
		accum 3 trigger_if_equal 81 tank run_81
		accum 3 trigger_if_equal 82 tank run_82
		accum 3 trigger_if_equal 83 tank run_83
		accum 3 trigger_if_equal 84 tank run_84
		accum 3 trigger_if_equal 85 tank run_85
		accum 3 trigger_if_equal 86 tank run_86
		accum 3 trigger_if_equal 87 tank run_87
		accum 3 trigger_if_equal 88 tank run_88
		accum 3 trigger_if_equal 89 tank run_89
		accum 3 trigger_if_equal 90 tank run_90
		accum 3 trigger_if_equal 91 tank run_91
		accum 3 trigger_if_equal 92 tank run_92
		accum 3 trigger_if_equal 93 tank run_93
		accum 3 trigger_if_equal 94 tank run_94
		accum 3 trigger_if_equal 95 tank run_95
		accum 3 trigger_if_equal 96 tank run_96
		accum 3 trigger_if_equal 97 tank run_97
		accum 3 trigger_if_equal 98 tank run_98
	}
// ===========================================================================================
// ===========================================================================================
	trigger run_0
	{
		accum 1 bitset 2
		followspline 0 spln0 80 wait length -64
		accum 1 bitreset 2
		
		trigger self run_continue
	}

	trigger run_1
	{
		accum 1 bitset 2
		followspline 0 spln1 80 wait length -64
		accum 1 bitreset 2
		
		trigger self run_continue
	}

	trigger run_2
	{
		accum 1 bitset 2
		followspline 0 spln2 80 wait length -64
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_3
	{
		accum 1 bitset 2
		followspline 0 spln3 80 wait length -64
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_4
	{
		accum 1 bitset 2
		followspline 0 spln4 80 wait length -64
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_5
	{
		accum 1 bitset 2
		followspline 0 spln5 80 wait length -64
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_6
	{
		accum 1 bitset 2
		followspline 0 spln6 80 wait length -64
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_7
	{
		accum 1 bitset 2
		followspline 0 spln7 80 wait length -64
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_8
	{
		accum 1 bitset 2
		followspline 0 spln8 80 wait length -64
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_9
	{
		accum 1 bitset 2
		followspline 0 spln9 80 wait length -64
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_10
	{
		accum 1 bitset 2
		followspline 0 spln10 80 wait length -64
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_11
	{
		accum 1 bitset 2
		followspline 0 spln11 80 wait length -64
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_12
	{
		accum 1 bitset 2
		followspline 0 spln12 80 wait length -64
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_13
	{
		accum 1 bitset 2
		trigger self tracks_turn_right
		followspline 0 spln13 80 wait length -64 roll 0 -3 dampin

		accum 1 bitreset 5
		trigger self tracks_forward

		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_14
	{
		accum 1 bitset 2
		followspline 0 spln14 80 wait length -64 roll -3 0
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_15
	{
		accum 1 bitset 2
		followspline 0 spln15 80 wait length -64  roll -3 0
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_16
	{
		accum 1 bitset 2
		followspline 0 spln16 80 wait length -64 roll -3 3 dampout
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_17
	{
		accum 1 bitset 2
		trigger self tracks_turn_right
		followspline 0 spln17 80 wait length -64

		accum 1 bitreset 5
		trigger self tracks_forward

		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_18
	{
		accum 1 bitset 2
		trigger self tracks_turn_right
		followspline 0 spln18 80 wait length -64

		accum 1 bitreset 5
		trigger self tracks_forward

		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_19
	{
		accum 1 bitset 2
		trigger self tracks_turn_right
		followspline 0 spln19 80 wait length -64 roll 0 3 dampin

		accum 1 bitreset 5
		trigger self tracks_forward

		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_20
	{
		accum 1 bitset 2
		followspline 0 spln20 80 wait length -64 roll 3 0
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_21
	{
		accum 1 bitset 2
		followspline 0 spln21 80 wait length -64 roll 3 0
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_22
	{
		accum 1 bitset 2
		followspline 0 spln22 80 wait length -64 roll 3 0
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_23
	{
		accum 1 bitset 2
		followspline 0 spln23 80 wait length -64 roll 3 0
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_24
	{
		accum 1 bitset 2
		followspline 0 spln24 80 wait length -64 roll 3 0
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_25
	{
		accum 1 bitset 2
		followspline 0 spln25 80 wait length -64 roll 3 0
		accum 1 bitreset 2

		trigger self run_continue
	}
	trigger run_26
	{
		accum 1 bitset 2
		followspline 0 spln26 80 wait length -64 roll 3 -3 dampout
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_27
	{
		accum 1 bitset 2
		followspline 0 spln27 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_28
	{
		accum 1 bitset 2
		followspline 0 spln28 80 wait length -64 roll 0 3
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_29
	{
		accum 1 bitset 2
		followspline 0 spln29 80 wait length -64 roll 3 0
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_30
	{
		accum 1 bitset 2
		followspline 0 spln30 80 wait length -64 roll 3 0
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_31
	{
		accum 1 bitset 2
		followspline 0 spln31 80 wait length -64 roll 3 0
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_32
	{
		accum 1 bitset 2
		followspline 0 spln32 80 wait length -64 roll 3 -3 dampout
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_33
	{
		accum 1 bitset 2
		followspline 0 spln33 80 wait length -64 roll 0 -3 dampin
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_34
	{
		accum 1 bitset 2
		followspline 0 spln34 80 wait length -64 roll -3 0
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_35
	{
		accum 1 bitset 2
		followspline 0 spln35 80 wait length -64 roll -3 0
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_36
	{
		accum 1 bitset 2
		followspline 0 spln36 80 wait length -64 roll -3 0
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_37
	{
		accum 1 bitset 2
		followspline 0 spln37 80 wait length -64 roll -3 0
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_38
	{
		accum 1 bitset 2
		followspline 0 spln38 80 wait length -64 roll -3 0
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_39
	{
		accum 1 bitset 2
		followspline 0 spln39 80 wait length -64 roll -3 0
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_40
	{
		accum 1 bitset 2
		followspline 0 spln40 80 wait length -64 roll -3 0
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_41
	{
		accum 1 bitset 2
		followspline 0 spln41 80 wait length -64 roll -3 3 dampout
		accum 1 bitreset 2

		wm_objective_status 1 0 2
		wm_objective_status 1 1 1

		wm_set_main_objective		2	0
		wm_set_main_objective		2	1

		trigger self run_continue
	}

	trigger run_42
	{
		accum 1 bitset 2
		followspline 0 spln42 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_43
	{
		accum 1 bitset 2
		followspline 0 spln43 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_44
	{
		accum 1 bitset 2
		followspline 0 spln44 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_45
	{
		accum 1 bitset 2
		followspline 0 spln45 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_46
	{
		accum 1 bitset 2
		followspline 0 spln46 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_47
	{
		accum 1 bitset 2
		followspline 0 spln47 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_48
	{
		accum 1 bitset 2
		followspline 0 spln48 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_49
	{
		accum 1 bitset 2
		followspline 0 spln49 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_50
	{
		accum 1 bitset 2
		followspline 0 spln50 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_51
	{
		accum 1 bitset 2
		followspline 0 spln51 80 wait length -64
		accum 1 bitreset 2

		trigger self script_lockout

		trigger self tracks_stop
		trigger tank_sound stop

		startanimation 45 	10 	15 nolerp norandom
		wait 666
		startanimation 0 	1 	15 nolerp norandom
		wait 900

		trigger self run_incpos

		trigger tank_turret turn1 // will break the lockout		
	}

	trigger run_52
	{
		accum 1 bitset 2
		followspline 0 spln52 80 wait length -64
		accum 1 bitreset 2
		trigger self run_continue
	}

	trigger run_53
	{
		accum 1 bitset 2
		followspline 0 spln53 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_54
	{
		accum 1 bitset 2
		followspline 0 spln54 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_55
	{
		accum 1 bitset 2
		followspline 0 spln55 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_56
	{
		accum 1 bitset 2
		followspline 0 spln56 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_57
	{
		accum 1 bitset 2
		followspline 0 spln57 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_58
	{

		//knock down outpost gates
		trigger gate_left flatten
		trigger gate_right flatten
		setstate gatehint invisible

		trigger game_manager objective2

		accum 1 bitset 2
		followspline 0 spln58 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_59
	{
		accum 1 bitset 2
		followspline 0 spln59 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_60
	{
		accum 1 bitset 2
		followspline 0 spln60 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_61
	{
		accum 1 bitset 2
		followspline 0 spln61 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_62
	{
		accum 1 bitset 2
		followspline 0 spln62 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_63
	{
		accum 1 bitset 2
		followspline 0 spln63 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_64
	{
		accum 1 bitset 2
		followspline 0 spln64 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_65
	{
		accum 1 bitset 2
		followspline 0 spln65 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_66
	{
		// **********************************
		trigger tankbarrier remove
		// **********************************
		accum 1 bitset 2
		followspline 0 spln66 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_67
	{

		accum 1 bitset 2
		followspline 0 spln67 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_68
	{
		accum 1 bitset 2
		followspline 0 spln68 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_69
	{
		accum 1 bitset 2
		followspline 0 spln69 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_70
	{
		accum 1 bitset 2
		followspline 0 spln70 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_71
	{
		accum 1 bitset 2
		followspline 0 spln71 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_72
	{
		accum 1 bitset 2
		followspline 0 spln72 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_73
	{
		accum 1 bitset 2
		followspline 0 spln73 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_74
	{
		accum 1 bitset 2
		followspline 0 spln74 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_75
	{
		accum 1 bitset 2
		followspline 0 spln75 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_76
	{
		accum 1 bitset 2
		followspline 0 spln76 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_77
	{
		accum 1 bitset 2
		followspline 0 spln77 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_78
	{
		accum 1 bitset 2
		followspline 0 spln78 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_79
	{
		accum 1 bitset 2
		followspline 0 spln79 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_80
	{
		accum 1 bitset 2
		followspline 0 spln80 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_81
	{
		accum 1 bitset 2
		followspline 0 spln81 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_82
	{
		accum 1 bitset 2
		followspline 0 spln82 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_83
	{
		accum 1 bitset 2
		followspline 0 spln83 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_84
	{
		accum 1 bitset 2
		followspline 0 spln84 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_85
	{
		accum 1 bitset 2
		followspline 0 spln85 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_86
	{
		accum 1 bitset 2
		followspline 0 spln86 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_87
	{
		accum 1 bitset 2
		followspline 0 spln87 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_88
	{
		accum 1 bitset 2
		followspline 0 spln88 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_89
	{
		accum 1 bitset 2
		followspline 0 spln89 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_90
	{
		accum 1 bitset 2
		followspline 0 spln90 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_91
	{
		accum 1 bitset 2
		followspline 0 spln91 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_92
	{
		accum 1 bitset 2
		followspline 0 spln92 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_93
	{
		accum 1 bitset 2
		followspline 0 spln93 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_94
	{
		accum 1 bitset 2
		followspline 0 spln94 80 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_95
	{
		accum 1 bitset 2
		followspline 0 spln95 70 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_96
	{
		trigger self tracks_turn_right
		accum 1 bitset 2
		followspline 0 spln96 60 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_97
	{
		accum 1 bitset 2
		followspline 0 spln97 60 wait length -64
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_98
	{
		accum 1 bitset 2
		followspline 0 spln98 60 wait length -64
		accum 1 bitreset 2

		trigger self script_lockout

		trigger tank_construct final_pos
		trigger self tracks_stop
		trigger tank_sound stop
		
		startanimation 45 	10 	15 nolerp norandom
		wait 666
		startanimation 0 	1 	15 nolerp norandom
		wait 900

		trigger tank_turret turn2

		trigger self run_incpos
	}
// ===========================================================================================
// ===========================================================================================
// stuck checking
	trigger stuck_check
	{
		accum 1 bitreset 3

		trigger self stuck_check_scriptlockout
		trigger self stuck_check_finished
		trigger self stuck_check_barrier
	}

	trigger stuck_check_finished
	{
		accum 3 abort_if_less_than 99

		accum 1 bitset 3
	}

	trigger stuck_check_scriptlockout
	{
		accum 5 abort_if_equal 0

		accum 1 bitset 3
	}

	trigger stuck_check_barrier
	{
		accum 3 abort_if_not_equal 66

		accum 1 abort_if_not_bitset 0

		accum 1 bitset 3
	}

// ===========================================================================================
// ===========================================================================================
// stop check

	trigger stopcheck_setup
	{
		//accum 1 bitset 6			// stop if we're stuck/no-one's pushing :)

		accum 1 abort_if_bitset 8		// no one in the trigger, abort

		trigger self stuck_check		// call the stop check function
		accum 1 abort_if_bitset 3		// we're stuck so break out

		//accum 1 bitreset 6			// we're free to move
	}

	trigger stopcheck
	{
		trigger self stopcheck_setup
		accum 1 abort_if_not_bitset 6

		trigger self script_lockout

		// Any just stopped moving stuff goes here
		trigger tank_sound 	stop
		trigger self 		tracks_stop
		startanimation 45 	10 	15 nolerp norandom
		wait 666
		startanimation 0 	1 	15 nolerp norandom
		wait 900

		trigger self script_lockout_stop
		resetscript
	}

// ===========================================================================================
// ===========================================================================================
// script lockouts

	trigger script_lockout
	{
		accum 5 inc 1
	}

	trigger script_lockout_stop
	{
		accum 5 inc -1
	}

// ===========================================================================================
// ===========================================================================================
// enable/disable

	trigger tank_enable
	{
		trigger self stuck_check
		accum 1 abort_if_bitset 3 	// stuck check

		accum 4 set 0				// reset stop counter
		accum 1 bitreset 8			// reset stop check

		accum 1 abort_if_bitset 2 	// already following spline
		accum 5 abort_if_not_equal 0	// are we not in a script lockout?

		accum 1 abort_if_bitset 7 	// death check

		// Any just started moving stuff goes here

		trigger self script_lockout

		trigger tank_sound start

		startanimation 55 10 15 nolerp norandom
		wait 666
		startanimation 5 40 15 nolerp norandom
		wait 500
		trigger self tracks_forward

		trigger self script_lockout_stop

		trigger self move
	}

	trigger tank_disable
	{
		accum 4 inc 1				// up the stop counter
		accum 4 abort_if_less_than 4

		accum 1 bitset 8			// set stop check

		trigger self deathcheck
	}

// ===========================================================================================
// ===========================================================================================
// death / rebirth

	rebirth
	{
		accum 1 bitreset 9 // we're visibly alive
		accum 1 bitreset 7 // we're alive again
		globalaccum 2 set 1	//tell gun we're alive

		trigger self script_lockout

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_tank_repaired_allies"

		wm_teamvoiceannounce 1 "allies_hq_tank_repaired"
		// *---------------------------------------------------------------------------------*
		wm_announce "The Tank has been repaired"

		changemodel models/mapobjects/tanks_c1/churchhill_c1.md3

		setstate tank_smoke invisible

		trigger tank_sound rebirth
		wait 500

		trigger self script_lockout_stop
	}

	death
	{
		accum 1 bitset 7
	}

	trigger deathcheck
	{
		accum 1 abort_if_not_bitset 7	// are we dead?
		accum 1 abort_if_bitset 9	// are we not already visibly dead?
		accum 1 abort_if_bitset 2	// are we not following a spline?
		accum 5 abort_if_not_equal 0	// are we not in a script lockout?

		accum 1 bitset 9		// we're now visibly dead
		globalaccum 2 set 0		// let gun know we're dead

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_tank_damaged"

		wm_teamvoiceannounce 1 "allies_hq_tank_damaged_axis"
		// *---------------------------------------------------------------------------------*

		wm_announce "The Tank has been damaged"

		changemodel models/mapobjects/tanks_c1/churchhill_broken_c1.md3

		setstate tank_smoke default

		kill tank_construct

		trigger self sound_death
		trigger self tracks_stop

		trigger self script_lockout

		trigger self tracks_stop
		startanimation 45 10 15 nolerp norandom
		wait 666
		startanimation 0 1 15 nolerp norandom

		trigger self script_lockout_stop

		resetscript
	}

	trigger enable_stage1
	{
		accum 1 bitreset 0
	}
	
	trigger disable_stage1
	{
		accum 1 bitset 0
	}
}

//target_script_trigger
tank_disabler
{
	trigger run
	{
		trigger tank tank_disable
	}
}

//target_script_trigger
tank_enabler
{
	trigger run
	{
		trigger tank tank_enable
	}
}

//trigger_multiple
tank_trigger
{
     spawn
     {
          wait 100

          attachtotag tank tag_turret
     }
}

//func_constructible
tank_build
{
     spawn
     {
          wait 100

          attachtotag tank tag_turret
     }
}


//toi
tank_construct
{
	spawn
	{
		wait 1000

		constructible_class 2
		constructible_health 1200
		constructible_constructxpbonus 10
		constructible_destructxpbonus 10
	}

	built final
	{
		alertentity tank
	}

	trigger final_pos
	{
		constructible_constructxpbonus 3
		constructible_destructxpbonus 3
	}
}

tank_turret
{
	spawn
	{
		wait 500
		attachtotag tank tag_turret
	}

	trigger turn1
	{
		wait 1000

		trigger tank spin_start
		faceangles 0 20 0 4000
		trigger tank spin_stop

		wait 500

		trigger tank startfire
		trigger tank avre_fire
		trigger tank_flash run1
	}

	trigger turn2
	{
		wait 1000

		trigger tank spin_start
		faceangles 0 33 0 4000
		trigger tank spin_stop

		wait 500

		trigger tank startfire
		trigger tank avre_fire
		trigger boomtrigger boom_all
		trigger tank_flash run2
	}

	trigger blow_truck
	{
		setstate tank_flash invisible
		togglespeaker snd_explosion_truck

		wait 200
		trigger tank stopfire

		trigger hurt_barrelblast1 boom

		trigger truck destroyed
	
		wait 200

		trigger tank spin_start
		faceangles 0 0 0 4000
		trigger tank spin_stop

		trigger tank script_lockout_stop
	}

	trigger blow_doors
	{
		setstate tank_flash invisible
		togglespeaker snd_explosion_library
		wait 200
		trigger tank stopfire

		alertentity lib_door1
		setstate doorframe invisible
		setstate doorframe_damaged default


		wm_objective_status 3 0 2
		wm_objective_status 3 1 1

		wm_set_main_objective		4	0
		wm_set_main_objective		4	1

		wait 100
		trigger boomtrigger voicealerts

		trigger tank spin_start
		faceangles 0 0 0 3000
		trigger tank spin_stop
		trigger tank sound_death
		trigger tank script_lockout_stop
	}
}

tank_smoke
{
	spawn
	{
		wait 100
		attachtotag tank tag_turret
		setstate tank_smoke invisible
	}
}

tank_explosion
{
	spawn
	{
		wait 200
		attachtotag tank tag_turret
	}
}

tank_explosion_sound
{
	spawn
	{
		wait 200
		attachtotag tank tag_turret
	}

	trigger explosion
	{
		playsound sound/weapons/mortar/mortar_expl2.wav volume 196
	}
}

tank_flash
{
	spawn
	{
		wait 100
		setstate tank_flash invisible
	}

	trigger run1
	{
		setstate tank_flash default
 		attachtotag tank_turret tag_flash
		faceangles 0 95 0 50

		wait 50

		trigger tank_turret blow_truck
	}

	trigger run2
	{
		setstate tank_flash default
		attachtotag tank_turret tag_flash
		faceangles 0 123 0 50

		wait 50

		trigger tank_turret blow_doors
	}
}	

// ============================================================================
// Gun stuff starts here
// ============================================================================

// Jeco Removed AT Gun Scripting

// *********************************************
// ******************* TRUCK *******************
// *********************************************

truck
{
	spawn
	{
		wait 50
		faceangles 0 5 0 50
		gotomarker truck_pc1 5000
	}

	trigger destroyed
	{
		trigger truck_engine sound_death
		alertentity truck_explo
		alertentity truck_crates
		trigger hurt_truckblast boom
		gotomarker truck_pc2 1000
		faceangles 5 5 15 gototime
		gotomarker truck_pc3 700
		faceangles 10 5 45 gototime
		gotomarker truck_pc4 400
		faceangles 5 5 70 gototime
		gotomarker truck_pc5 700
		faceangles 0 5 90 gototime
		gotomarker truck_pc6 650

		changemodel models/mapobjects/blitz_sd/blitzbody_damaged.md3

		wait 500
		setstate truck_smoke default
	}
}ll
		
truck_bwheel
{
	spawn
	{
		wait 500

		attachtotag truck tag_wback
	}
}

truck_fwheel
{
	spawn
	{
		wait 500

		attachtotag truck tag_wfront
	}
}

truck_smoke
{
	spawn
	{
		wait 300
		attachtotag truck tag_wfront
		setstate truck_smoke invisible
	}
}

truck_engine
{
	spawn
	{
		wait 200
		attachtotag truck tag_wfront

		trigger truck_engine sound_idle
	}

	trigger sound_idle
	{
		playsound sound/vehicles/truck/truck_idle.wav looping
	}

	trigger sound_death
	{
		stopsound
	}
}

hurt_barrelblast1
{
	spawn
	{
		wait 200
		setstate hurt_barrelblast1 invisible
	}

	trigger boom
	{
		setstate hurt_barrelblast1 default
		wait 100
		remove
	}
}

hurt_truckblast
{
	spawn
	{
		wait 200
		setstate hurt_truckblast invisible
	}

	trigger boom
	{
		setstate hurt_truckblast default
		wait 100
		remove
	}
}

// *********************************************
// ******************* MISC ********************
// *********************************************
//These gates are knocked down by the tank as it passes by the outpost.
gate_right
{
	spawn
	{
	remove
	}

	trigger flatten
	{
		wait 900
		faceangles 88 5 2 700 
	}
}

gate_left
{
	spawn
	{
	remove
	}

	trigger flatten
	{
		wait 500
		togglespeaker snd_gate_crash
		wait 300
		faceangles 90 0 0 650
	}
}


// *********************************
// ******* LIBRARY EXPLOSION *******
// *********************************

doorframe
{
	spawn
	{
		setstate doorframe_damaged default
		setstate libdoors_toi invisible
		setstate libdoors_cm_marker invisible
		remove
	}
}

boomtrigger
{
	trigger boom_all
	{
		trigger hurt_barrelblast2 boom
		trigger hurt_barrelblast3 boom
		trigger hurt_barrelblast4 boom
		trigger hurt_libblast boom
		wait 450
		setstate libdoors_toi invisible
		setstate libdoors_cm_marker invisible
	}

	trigger voicealerts
	{
		wait 2000

		// *----------------------------------- vo ------------------------------------------*

		wm_teamvoiceannounce 0 "venice_axis_obj_library"

		wm_teamvoiceannounce 1 "venice_allies_obj_library"

		// *---------------------------------------------------------------------------------*
		wm_set_round_timelimit 30
	}
}

hurt_barrelblast2
{
	spawn
	{
		wait 200
		setstate hurt_barrelblast2 invisible
	}

	trigger boom
	{
		setstate hurt_barrelblast2 default
		wait 100
		remove
	}
}

hurt_barrelblast3
{
	spawn
	{
		wait 200
		setstate hurt_barrelblast3 invisible
	}

	trigger boom
	{
		setstate hurt_barrelblast3 default
		wait 100
		remove
	}
}

hurt_barrelblast4
{
	spawn
	{
		wait 200
		setstate hurt_barrelblast4 invisible
	}

	trigger boom
	{
		setstate hurt_barrelblast4 default
		wait 100
		remove
	}
}

hurt_libblast
{
	spawn
	{
		wait 200
		setstate hurt_libblast invisible
	}

	trigger boom
	{
		wait 600
		setstate hurt_libblast default
		wait 100
		remove
	}
}

// **********************************************
// ****************** BOAT STUFF ****************
// **********************************************

boat_smoke
{
	spawn
	{
		wait 100
		attachtotag boat tag_engine
		setstate boat_smoke invisible
	}		
}

// sound "thread"
boat_engine
{
	spawn
	{
		wait 200
		attachtotag boat tag_engine
	}

	trigger start
	{
		trigger boat_engine sound_start
		trigger boat sound_mood_start
		wait 950
		trigger boat_engine sound_move
	}

	trigger stop
	{
		trigger boat_engine sound_stop
		trigger boat sound_mood_stop
	}

	// ========================================
	// sound events
	trigger sound_start
	{
		stopsound
		playsound sound/venice_c1/boat_start.wav volume 96
	}

	trigger sound_move
	{
		playsound sound/venice_c1/boat_run.wav looping
	}

	trigger sound_stop
	{
		stopsound
		playsound sound/venice_c1/boat_stop.wav volume 96
	}

	// ========================================
	// ========================================
}

boat_prop_hurt
{
	spawn
	{
		wait 200
		attachtotag boat tag_engine
		setstate boat_prop_hurt invisible
	}

	trigger on
	{
		setstate boat_prop_hurt default
	}

	trigger off
	{
		setstate boat_prop_hurt invisible
	}
}

boat_build
{
	spawn
	{
		wait 500
		attachtotag boat tag_engine
	}
}

boat_construct
{
	spawn
	{
		constructible_class 2
		constructible_health 1050
		constructible_constructxpbonus 10
		constructible_destructxpbonus 10
	}

	built final
	{
		alertentity boat

		wm_announce "The Boat has been repaired!"
	}
}

// digibob: ok, for once i'm gonna PLAN this one, so NOTHING WILL BREAK EVAR
// ============================================================================
// accum 0, relic collected
// accum 1
//  - bit 0: barrier 1 status 	( 0 = destroyed, 	1 = built 		)
//  - bit 1: barrier 2 status 	( 0 = destroyed, 	1 = built 		)
//  - bit 2: spline status 		( 0 = not moving, 	1 = moving 		)
//  - bit 3: stuck check flag 	( 0 = not stuck, 	1 = stuck 		)
//  - bit 4: script lockout 	( 0 = no lockout, 	1 = lockout		)
//  - bit 5: blank 				( 									)
//  - bit 6: temp register 		(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX)
//  - bit 7: death status 		( 0 = alive, 		1 = dead		)
//  - bit 8: player check 		( 0 = players, 		1 = no players	)
//  - bit 9: visible state		( 0 = alive, 		1 = dead		)
// accum 2, blank
// accum 3, current movement loop position
// accum 4, stop counter
// accum 5, blank
// accum 6, blank
// accum 7, blank
// ============================================================================
// spline points are b_splnX with X = 0 to 86
// ============================================================================
// propeller events:
//  - prop_start
//  - prop_stop

boat
{
	spawn
	{
		wait 50
		accum 1 bitset 5
		trigger self prop_stop

		//Reset the boat into correct position
		followspline 0 b_spln_st 10000 wait length 304
		//faceangles 0 270 0 50

	}

	trigger sound_mood_start
	{
		playsound sound/venice_c1/boat_loop2.wav looping
	}

	trigger sound_mood_stop
	{
		stopsound
	}

	// ========================================
	// prop-ilicious

	trigger prop_start
	{
		accum 1 abort_if_bitset 5
		accum 1 bitset 5
		remapshader "models/mapobjects/boat_c1/chriscraft_prop" "models/mapobjects/boat_c1/chriscraft_prop-s"
		remapshaderflush
		trigger boat_prop_hurt on
	}

	trigger prop_stop
	{
		accum 1 abort_if_not_bitset 5
		accum 1 bitreset 5
		remapshader "models/mapobjects/boat_c1/chriscraft_prop" "models/mapobjects/boat_c1/chriscraft_prop"
		remapshaderflush
		trigger boat_prop_hurt off
	}
	// ========================================
	// ========================================

	trigger add_relic
	{
		accum 0 inc 1

		trigger relic_full show
		trigger relic_trans hide
		trigger relic secured

		trigger self boat_escape_msg

		wm_announce "Allied team is escaping with the Relic!"		

		wm_objective_status 4 0 2
		wm_objective_status 4 1 1

		wm_set_main_objective 5 0
		wm_set_main_objective 5 1

		setstate relic_toi invisible
		setstate relic_cm_marker invisible
	}

	trigger boat_escape_msg
	{

		wm_announce "The Allies have stolen the boat!"

		// *----------------------------------- vo ------------------------------------------*

//		wm_teamvoiceannounce 0 "venice_axis_obj_relicsec"

//		wm_teamvoiceannounce 1 "venice_allies_obj_relicsec"

		// *---------------------------------------------------------------------------------*
	}

	// ========================================
	// movement

	trigger move_check
	{
		trigger boat stuck_check
		accum 1 abort_if_bitset 3

		trigger boat dispatch
	}

	trigger move
	{
		trigger boat move_check

		wait 500

		trigger boat move
	}

	// ========================================
	// ========================================
// ===========================================================================================
// ===========================================================================================

	trigger run_continue
	{
		accum 3 inc 1
		trigger boat deathcheck
		trigger boat stopcheck
		trigger boat move
	}

	trigger run_1
	{
		accum 1 bitset 2
		followspline 0 b_spln0 60 wait length 304
		followspline 0 b_spln1 70 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_2
	{
		accum 1 bitset 2
		followspline 0 b_spln2 90 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_3
	{
		accum 1 bitset 2
		followspline 0 b_spln3 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_4
	{
		accum 1 bitset 2
		followspline 0 b_spln4 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_5
	{


		accum 1 bitset 2
		followspline 0 b_spln5 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_6
	{
		accum 1 bitset 2
		followspline 0 b_spln6 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_7
	{
		accum 1 bitset 2
		followspline 0 b_spln7 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_8
	{
		accum 1 bitset 2
		followspline 0 b_spln8 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_9
	{
		accum 1 bitset 2
		followspline 0 b_spln9 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_11
	{
		accum 1 bitset 2
		followspline 0 b_spln11 110 wait length 304
		accum 1 bitreset 2
		accum 3 inc 1
		trigger boat run_continue
	}

	trigger run_13
	{
		accum 1 bitset 2
		followspline 0 b_spln13 110 wait length 304
		accum 1 bitreset 2
		accum 3 inc 1
		trigger boat run_continue
	}


	trigger run_15
	{
		accum 1 bitset 2
		followspline 0 b_spln15 110 wait length 304
		accum 1 bitreset 2
		accum 3 inc 1
		trigger boat run_continue
	}

	trigger run_17
	{
		accum 1 bitset 2
		followspline 0 b_spln17 110 wait length 304
		accum 1 bitreset 2
		accum 3 inc 1
		trigger boat run_continue
	}

	trigger run_19
	{
		accum 1 bitset 2
		followspline 0 b_spln19 110 wait length 304
		accum 1 bitreset 2
		accum 3 inc 1
		trigger boat run_continue
	}

	trigger run_21
	{
		accum 1 bitset 2
		followspline 0 b_spln21 110 wait length 304
		accum 1 bitreset 2
		accum 3 inc 1
		trigger boat run_continue
	}

	trigger run_23
	{
		accum 1 bitset 2
		followspline 0 b_spln23 110 wait length 304
		accum 1 bitreset 2
		accum 3 inc 1
		trigger boat run_continue
	}

	trigger run_25
	{
		accum 1 bitset 2
		followspline 0 b_spln25 110 wait length 304
		accum 1 bitreset 2
		accum 3 inc 1
		trigger boat run_continue
	}

	trigger run_27
	{
		accum 1 bitset 2
		followspline 0 b_spln27 110 wait length 304
		accum 1 bitreset 2
		accum 3 inc 1
		trigger boat run_continue
	}

	trigger run_29
	{
		accum 1 bitset 2
		followspline 0 b_spln29 110 wait length 304
		accum 1 bitreset 2
		accum 3 inc 1
		trigger boat run_continue
	}

	trigger run_31
	{
		accum 1 bitset 2
		followspline 0 b_spln31 110 wait length 304
		accum 1 bitreset 2
		accum 3 inc 1
		trigger boat run_continue
	}

	trigger run_33
	{
		accum 1 bitset 2
		followspline 0 b_spln33 110 wait length 304
		accum 1 bitreset 2
		accum 3 inc 1
		trigger boat run_continue
	}

	trigger run_35
	{
		accum 1 bitset 2
		followspline 0 b_spln35 110 wait length 304
		accum 1 bitreset 2
		accum 3 inc 2
		trigger boat run_continue
	}

	trigger run_37
	{
		accum 1 bitset 2
		followspline 0 b_spln37 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_38
	{
		accum 1 bitset 2
		followspline 0 b_spln38 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_39
	{
		accum 1 bitset 2
		followspline 0 b_spln39 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_40
	{
		accum 1 bitset 2
		followspline 0 b_spln40 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_41
	{
		accum 1 bitset 2
		followspline 0 b_spln41 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_42
	{
		accum 1 bitset 2
		followspline 0 b_spln42 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_43
	{
		accum 1 bitset 2
		followspline 0 b_spln43 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_44
	{
		// **********************************
		trigger boatbarrier1 remove
		// **********************************

		accum 1 bitset 2
		followspline 0 b_spln44 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_45
	{
		wm_announce "The Boat is past Boat Barrier #1!"

		accum 1 bitset 2
		followspline 0 b_spln45 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_46
	{
		accum 1 bitset 2
		followspline 0 b_spln46 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_47
	{
		accum 1 bitset 2
		followspline 0 b_spln47 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_48
	{
		accum 1 bitset 2
		followspline 0 b_spln48 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_49
	{
		accum 1 bitset 2
		followspline 0 b_spln49 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_50
	{
		accum 1 bitset 2
		followspline 0 b_spln50 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_51
	{
		accum 1 bitset 2
		followspline 0 b_spln51 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_52
	{
		accum 1 bitset 2
		followspline 0 b_spln52 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_53
	{
		accum 1 bitset 2
		followspline 0 b_spln53 100 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_54
	{
		accum 1 bitset 2
		followspline 0 b_spln54 70 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_55
	{
		accum 1 bitset 2
		followspline 0 b_spln55 70 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_56
	{
		accum 1 bitset 2
		followspline 0 b_spln56 80 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_57
	{
		accum 1 bitset 2
		followspline 0 b_spln57 100 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_58
	{
		accum 1 bitset 2
		followspline 0 b_spln58 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_59
	{
		accum 1 bitset 2
		followspline 0 b_spln59 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_60
	{
		accum 1 bitset 2
		followspline 0 b_spln60 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_61
	{
		accum 1 bitset 2
		followspline 0 b_spln61 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_62
	{
		accum 1 bitset 2
		followspline 0 b_spln62 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_63
	{
		accum 1 bitset 2
		followspline 0 b_spln63 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_64
	{
		accum 1 bitset 2
		followspline 0 b_spln64 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_65
	{
		accum 1 bitset 2
		followspline 0 b_spln65 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_66
	{
		accum 1 bitset 2
		followspline 0 b_spln66 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_67
	{
		accum 1 bitset 2
		followspline 0 b_spln67 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_68
	{
		accum 1 bitset 2
		followspline 0 b_spln68 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_69
	{
		accum 1 bitset 2
		followspline 0 b_spln69 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_70
	{
		accum 1 bitset 2
		followspline 0 b_spln70 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_71
	{
		// **********************************
		trigger boatbarrier2 remove
		// **********************************

		accum 1 bitset 2
		followspline 0 b_spln71 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_72
	{
		wm_announce "The Boat is past Boat Barrier #2!"

		accum 1 bitset 2
		followspline 0 b_spln72 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_73
	{
		accum 1 bitset 2
		followspline 0 b_spln73 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_74
	{
		accum 1 bitset 2
		followspline 0 b_spln74 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_75
	{
		accum 1 bitset 2
		followspline 0 b_spln75 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_76
	{
		accum 1 bitset 2
		followspline 0 b_spln76 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_77
	{
		accum 1 bitset 2
		followspline 0 b_spln77 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_78
	{
		accum 1 bitset 2
		followspline 0 b_spln78 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_79
	{
		accum 1 bitset 2
		followspline 0 b_spln79 110 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_80
	{
		accum 1 bitset 2
		followspline 0 b_spln80 90 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_81
	{
		accum 1 bitset 2
		followspline 0 b_spln81 70 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_82
	{
		accum 1 bitset 2
		followspline 0 b_spln82 60 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_83
	{
		accum 1 bitset 2
		followspline 0 b_spln83 60 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_84
	{
		accum 1 bitset 2
		followspline 0 b_spln84 60 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_85
	{
		accum 1 bitset 2
		followspline 0 b_spln85 60 wait length 304
		accum 1 bitreset 2

		trigger boat run_continue
	}

	trigger run_86
	{
		accum 1 bitset 2
		followspline 0 b_spln86 60 wait length 304
		accum 1 bitreset 2

		accum 3 inc 1
		trigger boat prop_stop
		trigger boat_engine stop

		trigger game_manager allies_win
	}

	trigger dispatch
	{
		accum 3 trigger_if_equal 0 	boat run_1
		accum 3 trigger_if_equal 1 	boat run_2
		accum 3 trigger_if_equal 2	boat run_3
		accum 3 trigger_if_equal 3 	boat run_4
		accum 3 trigger_if_equal 4 	boat run_5
		accum 3 trigger_if_equal 5 	boat run_6
		accum 3 trigger_if_equal 6 	boat run_7
		accum 3 trigger_if_equal 7 	boat run_8
		accum 3 trigger_if_equal 8 	boat run_9
		accum 3 trigger_if_equal 9 	boat run_11

		accum 3 trigger_if_equal 11	boat run_13

		accum 3 trigger_if_equal 13	boat run_15

		accum 3 trigger_if_equal 15	boat run_17

		accum 3 trigger_if_equal 17	boat run_19

		accum 3 trigger_if_equal 19	boat run_21

		accum 3 trigger_if_equal 21	boat run_23

		accum 3 trigger_if_equal 23	boat run_25

		accum 3 trigger_if_equal 25	boat run_27

		accum 3 trigger_if_equal 27	boat run_29

		accum 3 trigger_if_equal 29	boat run_31

		accum 3 trigger_if_equal 31	boat run_33

		accum 3 trigger_if_equal 33	boat run_35

		accum 3 trigger_if_equal 36	boat run_37
		accum 3 trigger_if_equal 37	boat run_38
		accum 3 trigger_if_equal 38	boat run_39
		accum 3 trigger_if_equal 39	boat run_40
		accum 3 trigger_if_equal 40	boat run_41
		accum 3 trigger_if_equal 41	boat run_42
		accum 3 trigger_if_equal 42	boat run_43
		accum 3 trigger_if_equal 43	boat run_44
		accum 3 trigger_if_equal 44	boat run_45
		accum 3 trigger_if_equal 45	boat run_46
		accum 3 trigger_if_equal 46	boat run_47
		accum 3 trigger_if_equal 47	boat run_48
		accum 3 trigger_if_equal 48	boat run_49
		accum 3 trigger_if_equal 49	boat run_50
		accum 3 trigger_if_equal 50	boat run_51
		accum 3 trigger_if_equal 51	boat run_52
		accum 3 trigger_if_equal 52	boat run_53
		accum 3 trigger_if_equal 53	boat run_54
		accum 3 trigger_if_equal 54	boat run_55
		accum 3 trigger_if_equal 55	boat run_56
		accum 3 trigger_if_equal 56	boat run_57
		accum 3 trigger_if_equal 57	boat run_58
		accum 3 trigger_if_equal 58	boat run_59
		accum 3 trigger_if_equal 59	boat run_60
		accum 3 trigger_if_equal 60	boat run_61
		accum 3 trigger_if_equal 61	boat run_62
		accum 3 trigger_if_equal 62	boat run_63
		accum 3 trigger_if_equal 63	boat run_64
		accum 3 trigger_if_equal 64	boat run_65
		accum 3 trigger_if_equal 65	boat run_66
		accum 3 trigger_if_equal 66	boat run_67
		accum 3 trigger_if_equal 67	boat run_68
		accum 3 trigger_if_equal 68	boat run_69
		accum 3 trigger_if_equal 69	boat run_70
		accum 3 trigger_if_equal 70	boat run_71
		accum 3 trigger_if_equal 71	boat run_72
		accum 3 trigger_if_equal 72	boat run_73
		accum 3 trigger_if_equal 73	boat run_74
		accum 3 trigger_if_equal 74	boat run_75
		accum 3 trigger_if_equal 75	boat run_76
		accum 3 trigger_if_equal 76	boat run_77
		accum 3 trigger_if_equal 77	boat run_78
		accum 3 trigger_if_equal 78	boat run_79
		accum 3 trigger_if_equal 79	boat run_80
		accum 3 trigger_if_equal 80	boat run_81
		accum 3 trigger_if_equal 81	boat run_82
		accum 3 trigger_if_equal 82	boat run_83
		accum 3 trigger_if_equal 83	boat run_84
		accum 3 trigger_if_equal 84	boat run_85
		accum 3 trigger_if_equal 85	boat run_86
	}

	// ========================================
	// barrier checking
	// digibob: since we cant return variables, just use bit 3 of accum 1 as a register... mmmm assembly......

	trigger stuck_check
	{
		accum 1 bitreset 3

		trigger boat stuck_check_relic
		trigger boat stuck_check_barrier1
		trigger boat stuck_check_barrier2
		trigger boat stuck_check_scriptlockout
		trigger boat stuck_check_finished
	}

	trigger stuck_check_finished
	{
		accum 3 abort_if_not_equal 86

		accum 1 bitset 3
	}

	trigger stuck_check_scriptlockout
	{
		accum 1 abort_if_not_bitset 4

		accum 1 bitset 3
	}

	trigger stuck_check_relic
	{
		accum 3 abort_if_not_equal 0

		accum 0 abort_if_greater_than 0

		accum 1 bitset 3
	}

	trigger stuck_check_barrier1
	{
		accum 3 abort_if_not_equal 43

		accum 1 abort_if_not_bitset 0

		accum 1 bitset 3
	}

	trigger stuck_check_barrier2
	{
		accum 3 abort_if_not_equal 70

		accum 1 abort_if_not_bitset 1

		accum 1 bitset 3
	}

	// ========================================
	// ========================================




	// ========================================
	// stop check

	trigger stopcheck_setup
	{
		//accum 1 bitset 6				// stop if we're stuck/no-one's pushing :)

		accum 1 abort_if_bitset 8		// no one in the trigger, abort

		trigger boat stuck_check		// call the stop check function
		accum 1 abort_if_bitset 3		// we're stuck so break out

		//accum 1 bitreset 6				// we're free to keep going
	}

	trigger stopcheck
	{
		trigger boat stopcheck_setup
		accum 1 abort_if_not_bitset 6

		trigger boat script_lockout

		// Any just stopped moving stuff goes here
		trigger boat_engine stop
		trigger boat prop_stop
		// <<<<< stop animation goes here

		trigger boat script_lockout_stop
		resetscript
	}

	// ========================================
	// ========================================




	// ========================================
	// script lockouts

	trigger script_lockout
	{
		accum 1 bitset 4
	}

	trigger script_lockout_stop
	{
		accum 1 bitreset 4
	}

	// ========================================
	// ========================================


	// ========================================
	// enable/disable

	trigger boat_enable
	{
		trigger boat stuck_check
		accum 1 abort_if_bitset 3 	// stuck check

		accum 4 set 0				// reset stop counter
		accum 1 bitreset 8			// reset stop check

		accum 1 abort_if_bitset 2 	// already following spline
		accum 1 abort_if_bitset 4 	// script lockout

		accum 1 abort_if_bitset 7 	// death check

		// Any just started moving stuff goes here
		trigger boat_engine start
		trigger boat prop_start
		// <<<<< start animation goes here
		trigger boat move
	}

	trigger boat_disable
	{
		accum 4 inc 1				// up the stop counter
		accum 4 abort_if_less_than 2

		accum 1 bitset 8			// set stop check

		trigger boat deathcheck
	}

	// ========================================
	// ========================================

	// ========================================
	// death / rebirth

	rebirth
	{
		accum 1 bitreset 7 // we're alive again
		accum 1 bitreset 9 // we're visibly alive


		trigger self script_lockout

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "venice_axis_boat_repaired"

		wm_teamvoiceannounce 1 "venice_allies_boat_repaired"
		// *---------------------------------------------------------------------------------*
		wm_announce "The Boat has been repaired"

		setstate boat_smoke invisible

		trigger self script_lockout_stop
	}

	death
	{
		accum 1 bitset 7
	}

	trigger deathcheck
	{
		accum 1 abort_if_not_bitset 7	// are we dead?
		accum 1 abort_if_bitset 9		// are we not already visibly dead?
		accum 1 abort_if_bitset 2		// are we not following a spline?
		accum 1 abort_if_bitset 4		// are we not in a script lockout?

		accum 1 bitset 9				// we're now visibly dead

		wm_announce "The Boat has been damaged!"

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "venice_axis_boat_damaged"

		wm_teamvoiceannounce 1 "venice_allies_boat_damaged"
		// *---------------------------------------------------------------------------------*

		setstate boat_smoke default
		kill boat_construct

		trigger boat_engine stop
		trigger boat prop_stop
		// <<<< stop anim goes here

		resetscript
	}

	trigger enable_stage1
	{
		accum 1 bitreset 0
	}

	trigger disable_stage1
	{
		accum 1 bitset 0
	}

	trigger enable_stage2
	{
		accum 1 bitreset 1
	}

	trigger disable_stage2
	{
		accum 1 bitset 1
	}
}

boat_trigger
{
	spawn
	{
		wait 500
		attachtotag boat tag_engine
	}
}

boat_disabler
{
	trigger run
	{
		trigger boat boat_disable
	}
}

boat_enabler
{
	trigger run
	{
		trigger boat boat_enable
	}
}

// *********************************************
// ****************** FLAG STUFF ***************
// *********************************************

relic_holder
{
	death
	{
		trigger boat add_relic
	}
}

// *********************************************
// ****************** RELIC STUFF **************
// *********************************************

relic
{
	spawn
	{
	}

	trigger stolen
	{
		enablespeaker snd_relic_taken
	}

	trigger secured
	{
		disablespeaker snd_relic_taken
		wm_announce "Allied team has secured the Relic!"

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_objective_lost"

		wm_teamvoiceannounce 1 "allies_hq_objective_secure"
		// *---------------------------------------------------------------------------------*

	}

	trigger returned
	{
		disablespeaker snd_relic_taken
	}
}

relic_full
{
	spawn
	{
		wait 500
		attachtotag boat tag_obj
		faceangles 0 0 -45 50
		
		setstate relic_full invisible
	}

	trigger show
	{
		setstate relic_full default
	}
}

relic_trans
{
	spawn
	{
		wait 500
		attachtotag boat tag_obj
		faceangles 0 0 -45 50
	}

	trigger hide
	{
		setstate relic_trans invisible
	}
}


// *********************************************
// **************** CONSTRUCTIBLES *************
// *********************************************
// ============================================================================
// Axis MG42 Nest - in front of church
// ============================================================================
// __________________________________
// __________________________________
// Jec: removed all 3 MG's as constructibles
// __________________________________
//___________________________________
// ============================================================================
// Allied FootBridge
// ============================================================================
// Jec Removed FootBridge from being Constructible

// ============================================================================
// Axis BoatBarriers
// ============================================================================
boatbarrier1
{
	spawn
	{
		wait 250
		trigger self setup

		constructible_class 3
		constructible_chargebarreq 1
	}

	trigger setup
	{
		setstate boatbarrier1_materials default
	}

	buildstart final
	{
	}

	built final
	{
		setstate boatbarrier1_materials invisible

		trigger boat disable_stage1

		wm_announce	"Boat Barrier #1 has been constructed."

	}

	decayed final
	{
		setstate boatbarrier1_materials default
	}

	death
	{
		setstate boatbarrier1_materials default

		trigger boat enable_stage1

		wm_announce	"Boat Barrier #1 has been destroyed."

	}

	trigger remove
	{
		setstate boatbarrier1_toi invisible
		setstate boatbarrier1_materials invisible

		remove
	}
}

boatbarrier2
{
	spawn
	{
		wait 250
		trigger self setup

		constructible_class 3
		constructible_chargebarreq 1
	}

	trigger setup
	{
		setstate boatbarrier2_materials default
	}

	buildstart final
	{
	}

	built final
	{
		setstate boatbarrier2_materials invisible

		trigger boat disable_stage2

		wm_announce	"Boat Barrier #2 has been constructed."

	}

	decayed final
	{
		setstate boatbarrier2_materials default
	}

	death
	{
		setstate boatbarrier2_materials default

		trigger boat enable_stage2

		wm_announce	"Boat Barrier #2 has been destroyed."

	}

	trigger remove
	{
		setstate boatbarrier2_toi invisible
		setstate boatbarrier2_materials invisible

		remove
	}
}
// ============================================================================
// Axis TankBarrier
// ============================================================================
tankbarrier
{
	spawn
	{
		wait 400
		trigger tankbarrier setup

		constructible_class 3
		constructible_chargebarreq 1

	}

	trigger setup
	{
		setstate tankbarrier_materials default
		setstate tankbarrier_sground default
		setstate tankbarrier_eground invisible
		setstate tankbarrier_teeth invisible
	}

	buildstart final
	{
		setstate tankbarrier_materials default
		setstate tankbarrier_teeth underconstruction
	}

	built final
	{
		setstate tankbarrier_materials invisible
		setstate tankbarrier_sground invisible
		setstate tankbarrier_eground default
		setstate tankbarrier_teeth default

		trigger tank disable_stage1

		wm_announce	"Tank Barrier has been constructed."
	}

	decayed final
	{
		setstate tankbarrier_materials default
		setstate tankbarrier_teeth invisible
	}

	death
	{
		setstate tankbarrier_materials default
		setstate tankbarrier_teeth invisible

		trigger tank enable_stage1

		wm_announce	"Tank Barrier has been destroyed."
	}

	trigger remove
	{
		setstate tankbarrier_toi invisible
		setstate tankbarrier_materials invisible
		setstate tankbarrier_teeth invisible

		remove
	}
}

/////////////////////////////////////////////////////////////
side_entrance
{
	spawn
	{
		wait 250
		setstate side_entrance_destroyed default
		setstate side_entrance_toi invisible
	remove
	}

	death
	{
		wm_announce "Allies have destroyed the Side Entrance!"
		wm_teamvoiceannounce 0 venice_axis_entrance2_destroyed
		wm_teamvoiceannounce 1 venice_allies_entrance2_destroyed
		setstate side_entrance_destroyed default
		setstate side_entrance_toi invisible
	}
}

lib_side_wall
{
	spawn
	{
		wait 250
		setstate lib_side_wall_built invisible
		setstate lib_side_wall_destroyed default
		remove
	}

	death
	{
		wm_announce "Allies have destroyed the Library Side Wall!"
		wm_teamvoiceannounce 0 venice_axis_libwall_destroyed
		wm_teamvoiceannounce 1 venice_allies_libwall_destroyed
		setstate lib_side_wall_built invisible
		setstate lib_side_wall_destroyed default
		setstate lib_side_wall_toi invisible

		alertentity lib_side_explosion
	}
}

church_rubble
{
	death
	{
		alertentity church_rubble_explosion
	}
}

piano_trigger1
{
	trigger play
	{
		togglespeaker piano_fmajor
	}
}

piano_trigger2
{
	trigger play
	{
		togglespeaker piano_gmajor
	}
}

piano_trigger3
{
	trigger play
	{
		togglespeaker piano_aminor
	}
}

piano_trigger4
{
	trigger play
	{
		togglespeaker piano_cmajor
	}
}

axisbasedoor
{
	trigger kill
	{
	remove
	}
}

axisbasedoor2
{
	trigger kill
	{
	remove
	}
}

outpostaxisdoor
{
	trigger kill
	{
	remove
	}
}